home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / proot.doc < prev    next >
Text File  |  1995-03-31  |  2KB  |  46 lines

  1. (Comp.sources.hp48) 
  2. Item: 37 by billw@hpcvra.cv.hp.com [William C Wickes] 
  3. Subj: Polynomial Rootfinder 
  4. Date: Wed Jan 15 1992 
  5.  
  6.               HP 48 Polynomial Rootfinder, for Real Coefficients 
  7.  
  8. The HP 48 object listed below in ->ASC form is a high-performance 
  9. polynomial root finder.  Those of you who remember the HP 71B Math Pac 
  10. will recognize this as the same as the PROOT command from that Pac; it 
  11. is in fact the same assembly-language code, given an RPL front end to 
  12. operate in the HP 48. I will refer to the object as PROOT; you can, of 
  13. course, give it any name you please by storing it in a global variable. 
  14.  
  15. PROOT takes a (real) vector of coefficients in descending order, and 
  16. returns a complex vector containing the polynomial roots: 
  17.  
  18.              [ An An-1 An-2 ... A0 ] PROOT -> [ R1 R2 ... Rn ] 
  19.  
  20. represents the determination of the n (complex) zeros R1 ... Rn of the 
  21. nth-order polynomial 
  22.  
  23.                     An x^n + An-1 x^n-1 + ... + A0 
  24.  
  25. There is no limit on n, other than available memory and execution time. 
  26. The coefficients Ai must be real numbers, but this limitation is at 
  27. least partially compensated for by the speed and accuracy of the 
  28. algorithm.  Also, no initial guess or stopping criterion is required. 
  29. PROOT uses Laguerre's method for n>2, or the quadratic or linear 
  30. formulas for n<=2. You are referred to the HP 71 Math Pac Owner's Manual 
  31. for more information. 
  32.  
  33. The use of vectors rather than lists for the input and output derives 
  34. from PROOT's HP71 origins.  You can easily add list/vector conversion 
  35. around this object to make a more versatile version.  To be more fully 
  36. compliant with HP 48 style you can write user-language programs to 
  37. extract the polynomial coefficients from an arbitrary expression to use 
  38. as a preliminary to PROOT, and to convert the result elements back into 
  39. a factored expression (x-R1)(x-R2)...(x-Rn).  Examples of such programs 
  40. are listed in HP 48 Insights Part II (if you'll excuse the plug). 
  41.  
  42. Enjoy. 
  43.  
  44. Bill Wickes 
  45. HP Corvallis Division 
  46.